From 2cad22d41f621dc86401730d5dcec3191347054e Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 4 Jun 2009 10:37:39 +0100 Subject: [PATCH] xend: pass-through: report attach errors from device model Cc: Masaki Kanno Cc: Edwin Zhai Signed-off-by: Simon Horman --- tools/python/xen/xend/XendDomainInfo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index b4e6e49cf5..b1befd7267 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -752,6 +752,12 @@ class XendDomainInfo: vslot = xstransact.Read("/local/domain/0/device-model/%i/parameter" % self.getDomid()) + try: + vslot_int = int(vslot, 16) + except ValueError: + raise VmError(("Cannot pass-through PCI function '%s'. " + + "Device model reported an error: %s") % + (bdf_str, vslot)) else: vslot = new_dev['vslot'] -- 2.30.2